]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
viewSelector: Remove duplicate call to showPage
authorCarlos Soriano <carlos.soriano89@gmail.com>
Mon, 14 Jul 2014 16:55:34 +0000 (18:55 +0200)
committerCarlos Soriano <carlos.soriano89@gmail.com>
Fri, 8 Aug 2014 14:40:41 +0000 (16:40 +0200)
We were calling twice showPage() with the correct page, here and in
show() / zoomFromOverview given that _resetShowAppsbutton was called
from the signal 'showing' of overview.  Given that the call to
_resetShowAppsbutton is only actually used when hiding the overview we
can actually put the checked state of the button to false when animating
from overview so it shows the workspace page, causing the same behavior
of _resetShowAppsbutton without all the shenanigans of resetting when
the hiding overview signal is triggered.

https://bugzilla.gnome.org/show_bug.cgi?id=732901

js/ui/viewSelector.js

index 778bb579edcee24835db3c662dd61603132b1db0..bf2d73311847f84e6dcaddfbc233f690c56ae0a3 100644 (file)
@@ -188,7 +188,6 @@ const ViewSelector = new Lang.Class({
     _init : function(searchEntry, showAppsButton) {
         this.actor = new Shell.Stack({ name: 'viewSelector' });
 
-        this._showAppsBlocked = false;
         this._showAppsButton = showAppsButton;
         this._showAppsButton.connect('notify::checked', Lang.bind(this, this._onShowAppsButtonToggled));
 
@@ -251,13 +250,11 @@ const ViewSelector = new Lang.Class({
         this._stageKeyPressId = 0;
         Main.overview.connect('showing', Lang.bind(this,
             function () {
-                this._resetShowAppsButton();
                 this._stageKeyPressId = global.stage.connect('key-press-event',
                                                              Lang.bind(this, this._onStageKeyPress));
             }));
         Main.overview.connect('hiding', Lang.bind(this,
             function () {
-                this._resetShowAppsButton();
                 if (this._stageKeyPressId != 0) {
                     global.stage.disconnect(this._stageKeyPressId);
                     this._stageKeyPressId = 0;
@@ -319,6 +316,7 @@ const ViewSelector = new Lang.Class({
     },
 
     zoomFromOverview: function() {
+        this._showAppsButton.checked = false;
         this._workspacesDisplay.zoomFromOverview();
 
         if (!this._workspacesDisplay.activeWorkspaceHasMaximizedWindows())
@@ -370,7 +368,7 @@ const ViewSelector = new Lang.Class({
             });
     },
 
-    _showPage: function(page, noFade) {
+    _showPage: function(page) {
         if (page == this._activePage)
             return;
 
@@ -378,7 +376,7 @@ const ViewSelector = new Lang.Class({
         this._activePage = page;
         this.emit('page-changed');
 
-        if (oldPage && !noFade)
+        if (oldPage)
             Tweener.addTween(oldPage,
                              { opacity: 0,
                                time: OverviewControls.SIDE_CONTROLS_ANIMATION_TIME,
@@ -389,7 +387,7 @@ const ViewSelector = new Lang.Class({
                                    })
                              });
         else
-            this._fadePageIn(oldPage);
+            this._fadePageIn();
     },
 
     _a11yFocusPage: function(page) {
@@ -398,21 +396,10 @@ const ViewSelector = new Lang.Class({
     },
 
     _onShowAppsButtonToggled: function() {
-        if (this._showAppsBlocked)
-            return;
-
         this._showPage(this._showAppsButton.checked ?
                        this._appsPage : this._workspacesPage);
     },
 
-    _resetShowAppsButton: function() {
-        this._showAppsBlocked = true;
-        this._showAppsButton.checked = false;
-        this._showAppsBlocked = false;
-
-        this._showPage(this._workspacesPage, true);
-    },
-
     _onStageKeyPress: function(actor, event) {
         // Ignore events while anything but the overview has
         // pushed a modal (system modals, looking glass, ...)